import request from '@/utils/request'

// 创建需求
export function createRequire(data) {
  return request({
    url: `/idea/create`,
    method: 'post',
    data
  })
}
// 修改需求
export function updateRequire(data) {
  return request({
    url: `/idea/update`,
    method: 'put',
    data
  })
}
// 删除需求
export function deleteRequire(params) {
  return request({
    url: `/idea/delete`,
    method: 'delete',
    params
  })
}
// 需求列表
export function requirementList(data) {
  return request({
    url: `/idea/list`,
    method: 'post',
    data
  })
}
// 需求详情
export function requirementDetail(id) {
  return request({
    url: `/idea/detail?id=${id}`,
    method: 'get'
  })
}
// 提交审核
export function submitAudit(id) {
  return request({
    url: `/idea/commit?id=${id}`,
    method: 'get'
  })
}

// 审批操作
export function approveOperation(data) {
  return request({
    url: `/idea/check`,
    method: 'post',
    data
  })
}

// 评估操作
export function evaluateOperation(data) {
  return request({
    url: `/idea/assess`,
    method: 'post',
    data
  })
}

// 重新评估
export function reappraiseOperation(data) {
  return request({
    url: `/idea/repeat/check`,
    method: 'post',
    data
  })
}

// 操作记录列表
export function logList(data) {
  return request({
    url: `/idea/history/list`,
    method: 'post',
    data
  })
}

// 模糊搜索已通过未立项的需求
export function searchPassRequire(data) {
  return request({
    url: `/idea/agree/list`,
    method: 'post',
    data
  })
}
